import { myrequest } from "../../request/index.js";
Page({
  data: {
    // 轮播图数组
    swiperList: [],
    // 导航数组
    cateList: [],
    // 楼层数组
    floorList: []
  },
  // 页面加载就会触发
  onLoad(options) {
    this.getSwiperList()
    this.getCateList()
    this.getFloorList()
  },
  // 轮播图数据
  async getSwiperList() {
    const { data: res } = await myrequest({
      url: '/home/swiperdata',
    })
    this.setData({
      swiperList: res.message
    })
  },
  // 导航数据
  async getCateList() {
    const { data: res } = await myrequest({
      url: '/home/catitems',
    })
    this.setData({
      cateList: res.message
    })
  },
  // 楼层数据
  async getFloorList() {
    const { data: res } = await myrequest({
      url: '/home/floordata'
    })
    this.setData({
      floorList: res.message
    })
  }
});